﻿Imports Microsoft.Xna.Framework.Input

Public NotInheritable Class Xbox360Controller
    Implements IController

    Private m_index As Microsoft.Xna.Framework.PlayerIndex

    Public Sub New(ByVal controllerIndex As Microsoft.Xna.Framework.PlayerIndex)
        m_index = controllerIndex
    End Sub

    Public Function GetLeftStickPos() As System.Drawing.PointF Implements IController.GetLeftStickPos

    End Function

    Public Function GetRightStickPos() As System.Drawing.PointF Implements IController.GetRightStickPos

    End Function

    Public Function IsConnected() As Boolean Implements IController.IsConnected
        Return GamePad.GetState(m_index).IsConnected
    End Function

    Private disposedValue As Boolean = False        ' To detect redundant calls

    ' IDisposable
    Protected Sub Dispose(ByVal disposing As Boolean)
        If Not Me.disposedValue Then
            If disposing Then
                ' TODO: free other state (managed objects).
            End If

            ' TODO: free your own state (unmanaged objects).
            ' TODO: set large fields to null.
        End If
        Me.disposedValue = True
    End Sub

#Region " IDisposable Support "
    ' This code added by Visual Basic to correctly implement the disposable pattern.
    Public Sub Dispose() Implements IDisposable.Dispose
        ' Do not change this code.  Put cleanup code in Dispose(ByVal disposing As Boolean) above.
        Dispose(True)
        GC.SuppressFinalize(Me)
    End Sub
#End Region

End Class
